ErrorInfo = function() {
    var errorMessage = {
        POSTTOOMORE: '<div class="sorry" id="tishi"><p><span class="red"><img src="http://pic2.58.com/images/5_0/ok4848.gif" align="absmiddle" /></span></p>' +
            '<p>{MESSAGE}</p></div>',
        BLACKUSER: '<div class="sorry" id="tishi"><p><span class="red"><img src="http://pic2.58.com/images/5_0/ok4848.gif" align="absmiddle" /></span></p>' +
           '<p>{MESSAGE}<br /></div>',
        SEALEDUSER: '<div class="sorry" id="tishi"><p><span class="red"><img src="http://pic2.58.com/images/5_0/ok4848.gif" align="absmiddle" /></span></p>' +
            '<p>{MESSAGE}</p><br /></div>',
        INFOREPEATE: '<div class="xiangsi"><p class="bt"><span class="red"><img src="http://pic2.58.com/images/5_0/ok4848.gif" align="absmiddle" /></span></p>' +
            '<p>{MESSAGE}</p><br /></div>',
        INFOILLEGAL: '<div class="sorry" id="tishi"><p class="bt"><span class="red"><img src="http://pic2.58.com/images/5_0/ok4848.gif" align="absmiddle" /></span></p>' +
             '<p>{MESSAGE}</p><br /></div>',
        INFOGUANSHUI: '<div class="sorry" id="tishi"><p class="bt"><span class="red"><img src="http://pic2.58.com/images/5_0/ok4848.gif" align="absmiddle" /></span></p>' +
             '<p>{MESSAGE}</p><br /></div>',
        INFOSCORE: '<div class="sorry1" id="tishi"><p class="bt"></p>' +
             '<p>{MESSAGE}</p><br /><p><input name="" type="button" value="返回修改" onclick="reclose()"/><input name="" type="button" value="继续发布" onclick="fabu()"/></p></div>',
        FORBIDDEN: '<div class="sorry1" id="tishi"><p class="bt"></p><p>{MESSAGE}</p><br /><p align=center style="margin-bottom:10px;"><input type=\'button\' value=\'知道了\' onclick=\'window.location.href=\"http://www.58.com\"\'></p></div>',
        EX: '<div class="sorry" id="tishi"><p class="bt"><span class="red"><img src="http://pic2.58.com/images/5_0/ok4848.gif" align="absmiddle" />　发布失败！</span></p>' +
             '<p>系统异常。请与管理员联系。</p><br /><p><input name="" type="button" value="确定" onclick="turnPage()"/></p></div>'
    };
    var o = this;
    o.S_Message = function(obj) {
        var t = obj.t;
        if (obj.Order == 1) {
            if (t == "unlogin") {
                setbg('用户登录', 410, 250, 'http://my.58.com/SimLogin/?type=loginclose', 'false');
            }
            else {
                o.initMessage1(obj);
            }
        }
        else {
            if (document.all) {
                window.onload = function() {
                    o.initMessage(obj);
                }
            }
            else {
                o.initMessage(obj);
            }
        }
    }
    o.initMessage = function(obj) {
        window.scrollTo(0, 0);
        layer = new GGServer.Class.webUI.Layer();
        layer.type = "ErrorHTML";
        layer.isClose = false;
        layer.button = 'fabu';
        layer.init();
        layer.typeHTML.ErrorHTML = errorMessage[obj.t];
        var w = "450px", h = "400px";
        layer.closeWindow = false;
        var msglist = [];
        switch (obj.t) {
            case "POSTTOOMORE":
                {
                    w = "500px";
                    if (obj.user.ucr != 0) {
                        msglist.push("亲爱的<b>{0}</b>,您的信用值为<font color='red'>{1}</font>,今天您在<b>{2}</b>已达到<b><font color='red'>{3}</font></b>条信息的发帖上线。您可以提高信用来增加发帖量!<br>");
                    }
                    else {
                        msglist.push("亲爱的<b>{0}</b>,您的信用值为<font color='red'>0</font>（<a href='http://about.58.com/v5/jifenxinyong.html#g'>查看原因</a>）,目前只能提高信用才能发布信息。<br>");
                    }
                    msglist.push("<br>");
                    msglist.push("提高信用的方法：<br>");
                    msglist.push("1、<a href='http://my.58.com/UserAuthMail/'>验证邮箱</a>   (可获得50信用)<br/>");
                    msglist.push("2、<a href='http://my.58.com/UserAuthMobile/'>验证手机号码</a>   (可获得100信用)<br/>");
                    msglist.push("3、<a href='http://my.58.com/UserAuthRealName/'>验证身份</a>   (可获得150信用)<br/>");
                    msglist.push("4、<a href='http://my.58.com/UserAuthBiz/'>企业验证营业执照</a>   (可获得150信用)<br/>");
                    msglist.push("5、<a href='http://about.58.com/v5/jifenxinyong.html#g'>查看更多办法</a><br/>");
                    msglist.push("<p align=center><input type=button value='马上验证' onclick='window.location.href=\"http://my.58.com\"'></p>");
                    layer.closeWindow = true;
                    break;
                }
            case "BLACKUSER": { layer.closeWindow = false; break; }
            case "SEALEDUSER":
                {
                    msglist.push("<br>亲爱的<b>{0}</b>，您的账户已被冻结（<a href='http://about.58.com/v5/58xxzl.html#d'>查看原因</a>）。");
                    msglist.push("<p align=center><input type='button' value='知道了' onclick='window.location.href=\"http://my.58.com\"'></p>");
                    layer.closeWindow = true; break;
                }
            case "INFOREPEATE": { h = "350px"; break; }
            case "INFOILLEGAL": { break; }
            case "INFOGUANSHUI":
                {
                    w = "400px";
                    h = "260px";
                    msglist.push("<br>亲爱的<b>{0}</b>，您发布信息太过频繁了，请稍候再试!<br><br>");
                    msglist.push("<p align=center><input type='button' value='知道了' onclick='window.location.href=\"http://my.58.com\"'></p>");
                    break;
                }
            case "INFOSCORE":
                {
                    var color = "";
                    var width = "";
                    //alert(obj.msg);
                    var msgArray = obj.msg.split('$');
                    var tipList = msgArray[1].split('|');
                    var score = Number(msgArray[0]).fixed(2);
                    if (score < 5) {
                        color = "redBar";
                    }
                    else {
                        color = "orangeBar";
                    }
                    width = score * 10 + "%"
                    var messageHTML = '<div id="win-ct">本条信息的质量分为：';
                    messageHTML += '<p class="scor"><span style="float:left">0</span><span style="float:right">10</span><i class="orange">' + score + '</i><cite>分</cite></p><div class="ColorBox"><span style="width:' + width + ';" class="' + color + '"></span></div>';
                    // messageHTML += '<div class="ColorBox"><span style="width:' + width + ';" class="' + "orangeBar" + '"></span></div>';
                    messageHTML += '<p></p>' +
                            '<h3>信息质量满分为10分，如何提高本条信息质量：</h3>' +
                            '<ol>';
                    for (var i = 1; i <= tipList.length; i++) {
                        messageHTML += '<li>' + i + "、" + tipList[i - 1] + '</li>';
                    }
                    messageHTML += '</ol></div>';
                    layer.typeHTML.ErrorHTML = layer.typeHTML.ErrorHTML.replace(/{MESSAGE}/g, messageHTML);
                    w = "450px";
                    break;
                }
            case "FORBIDDEN":
                {
                    layer.closeWindow = true;
                    h = "280px";
                    break;
                }
        }
        if (obj.user != null) {
            obj.msg = msglist.join("").replace("{0}", obj.user.uname).replace("{1}", obj.user.ucr).replace("{2}", obj.user.curcate).replace("{3}", obj.user.maxpostcount);
        }
        if (obj.t != "INFOSCORE") { layer.typeHTML.ErrorHTML = layer.typeHTML.ErrorHTML.replace(/{MESSAGE}/g, obj.msg); }
        layer.typeHTML.width = w;
        layer.typeHTML.height = h;
        layer.event('ErrorHTML', 'void 0');
    }
    o.initMessage1 = function(obj) {
        //window.scrollTo(0, 0);
        try { o.hidtishi(); }
        catch (ex) { }
        var errormessagelist = obj.msg;
        var container = document.getElementById("toperro");
        container.className = "sc"
        container.style.display = '';
        var m = [];
        m.push("<strong>发布失败</strong><br />");
        for (var i = 0; i < errormessagelist.length; i++) {
            m.push((i + 1) + "、" + errormessagelist[i] + "<br/>");
        }
        container.innerHTML = m.join("");
        scrollToElement(container); // 定位到错误显示控件
        //document.getElementById("fabu").disabled = false;
        flagSubmit = false;
        //try { clearInterval(subTimerID); ti = 10; } catch (EXX) { }

        document.getElementById('fabu').value = "发布";
        document.getElementById('fabu').disabled = false;
        reloadImg();
    }
    o.hidtishi = function() {
        var tishi = document.getElementById("topinfomsg");
        if (tishi) {
            tishi.style.display = 'none';
        }
    }
}
 function turnPage(url)
 {
      if(url)
      {
      window.location.href = url;
      return;
      }
      window.location.href = "http://post.58.com/"+cityid;
 }
 function reclose()
 {
     layer.closeWindow =false;
     layer.isClose = false;
     layer.isDiv = true;
     layer.reset();
     reloadImg();
}
function fabu() {
  var inputHid = document.createElement("input");
  inputHid.type="hidden";
  inputHid.name="chid";
  inputHid.value='1';
  var subForm = document.getElementById("aspnetForm");
  subForm.appendChild(inputHid);
  subForm.action=window.location.href;
  subForm.submit();
  //subForm.disabled = true;  
}
Number.prototype.fixed=function(n)   
{   
  var   Num=this;   
  with(Math){   return   round(Num*pow(10,n))/pow(10,n);   }   
} 